package org.rslai.autotest.core.page.impl;

import org.rslai.autotest.core.page.Conf;
import org.springframework.beans.factory.annotation.Value;

/**
 * 保存配置信息
 * @author rslai
 */
public class ConfImpl implements Conf {

	@Value("${driver.singleDriver}")
	private boolean driverSingleDriver; // 是否启动一次浏览器
	
	@Value("${driver.remoteWebDriver.address}")
	protected String driverRemoteWebDriverAddress; // 运行测试脚本的客户机地址

	@Value("${driver.timeout.implicitlyWait}")
	protected int driverTimeoutImplicitlyWait; // 元素查找默认超时时间

	@Value("${driver.window.maximize}")
	protected boolean driverWindowMaximize; // 是否将浏览器最大化

	@Value("${website.baseUrl}")
	private String websiteBaseUrl; // 被测网站的url

	@Value("${webdriverwait.timeout}")
	private int webdriverwaitTimeout; // 使用wait查找对象的超时时间

	@Value("${driver.playback.speed}")
	private int driverPlaybackSpeed; // 设置回放速度 (0:不延时,1:延时1S)

	@Override
	public boolean getDriverSingleDriver() {
		return this.driverSingleDriver;
	}

	@Override
	public String getDriverRemoteWebDriverAddress() {
		return this.driverRemoteWebDriverAddress;
	}

	@Override
	public int getDriverTimeoutImplicitlyWait() {
		return this.driverTimeoutImplicitlyWait;
	}

	@Override
	public boolean getDriverWindowMaximize() {
		return this.driverWindowMaximize;
	}

	@Override
	public String getWebsiteBaseUrl() {
		return this.websiteBaseUrl;
	}

	@Override
	public int getWebdriverwaitTimeout() {
		return this.webdriverwaitTimeout;
	}

	@Override
	public int getDriverPlaybackSpeed() {
		return this.driverPlaybackSpeed;
	}

}
